﻿
@{
    ViewData["Title"] = "网站设置";
    Layout = "~/Areas/Manager/Views/Shared/_Layout.cshtml";
}
@inject Sykj.IServices.IConfigsys _configsys
@section scriptstop
    {
    <script type="text/javascript" charset="utf-8" src="~/ueditor/ueditor.config.js"></script>
    <script type="text/javascript" charset="utf-8" src="~/ueditor/ueditor.all.min.js"></script>
    <script type="text/javascript" src="~/manager/js/jquery.min.js"></script>
}
<div class="layui-fluid">
    <div class="layui-row layui-col-space15">
        <div class="layui-col-md12">
            <div class="layui-card">
                <div class="layui-card-header">网站设置</div>
                <div class="layui-card-body">
                    <form class="layui-form" style="padding: 20px 30px 0 0;" method="post">

                        <div class="layui-form-item">
                            <label class="layui-form-label">网站名称</label>
                            <div class="layui-col-xs10">
                                <input id="WebSite" name="WebSite" value="@_configsys.GetValue("WebSite")" lay-verify="required" class="layui-input">
                            </div>
                            <div class="layui-tips-danger">
                                *必填
                            </div>
                        </div>
                        <div class="layui-form-item">
                            <label class="layui-form-label">主域名</label>
                            <div class="layui-col-xs10">
                                <input id="BaseHost" name="BaseHost" value="@_configsys.GetValue("BaseHost")" lay-verify="required" class="layui-input">
                            </div>
                            <div class="layui-tips-danger">
                                *必填
                            </div>
                        </div>
                        <div class="layui-form-item">
                            <label class="layui-form-label">API域名</label>
                            <div class="layui-col-xs10">
                                <input id="ApiHost" name="ApiHost" value="@_configsys.GetValue("ApiHost")" lay-verify="required" class="layui-input">
                            </div>
                            <div class="layui-tips-danger">
                                *必填
                            </div>
                        </div>
                        <div class="layui-form-item">
                            <label class="layui-form-label">图片域名</label>
                            <div class="layui-col-xs10">
                                <input id="ImagesDomain" name="ImagesDomain" value="@_configsys.GetValue("ImagesDomain")" lay-verify="required" class="layui-input">
                            </div>
                            <div class="layui-tips-danger">
                                *必填
                            </div>
                        </div>

                        <div class="layui-form-item">
                            <label class="layui-form-label">注册协议</label>
                            <div class="layui-col-xs10">
                                <textarea id="RegisterProtocol" style=" height:200px" name="RegisterProtocol">@_configsys.GetValue("RegisterProtocol")</textarea>
                            </div>
                            <div class="layui-tips-danger">
                                *必填
                            </div>
                        </div>
                        <div class="layui-form-item">
                            <label class="layui-form-label"></label>
                            <div class="layui-col-xs5">
                                <button class="layui-btn" lay-submit lay-filter="edit" id="submit" type="button">提交</button>
                            </div>
                        </div>
                    </form>
                </div>
            </div>
        </div>
    </div>
</div>
@section scriptsfeet
        {
    <script type="text/javascript">
        layui.config({
            base: '/layuiadmin/' //静态资源所在路径;
        }).use(['form', 'sykjwh'], function () {

            var $ = layui.$
                , form = layui.form
                , sykjwh = layui.sykjwh;

            //表单提交
            form.on('submit(edit)', function (obj) {
                console.log(obj.field);
                //保存
                sykjwh.save('@Url.Action("WebSite", "config", new { area = Constant.AREAMANAGER })', obj.field);
            });

            //实例化编辑器
            UE.getEditor('RegisterProtocol', { autoHeightEnabled: false });
        });
    </script>
}